home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
GOOSEIV.422
< prev
next >
Wrap
Text File
|
1993-02-27
|
21KB
|
483 lines
Enhanced Message Quote Mod for WWIV 4.22 (QUOTE324.MOD)
Goose #1 @17310
Thursday, February 25, 1993 8:06 pm
Enhanced Message Quoting Mod v3.24 (QUOTE324.MOD)
for WWIV 4.22
by Goose, 1@17310 (WWIVlink)
Once again, it's time for an update to the Quote Mod. This version is again
WWIV 4.22 specific, since it uses the routine Wayne has built into the code
for 4.22. But, added are colorized quotes (from v3.21 of the mod), and
initials in quote (v3.22 of the mod), and the correction of initial guessing
for WWIV 4.22 and FIDO gated messages (v3.23 of the mod).
Thanks to Wafwot, 113@2050 (I'm not sure what system he runs) for the base
code for the initials. I changed it a little and integrated it with the rest
of the mod here. And thanks to Hellfire #1 @13600 for the fixes for v3.23 of
the mod.
This is a new version of the mod, which is specifically for WWIV 4.22 (and
I'm assuming later versions). This mod relies on the quote support that Wayne
built in, which unfortuntely only works with external editors that support the
QUOTES.IND file. Once you've installed this, you'll have the familiar Ctrl-P
Ctrl-Q for any external editor or /QUOTE for the internal editor back. But,
to make sure you see it, I'll leave in the following paragraph:
== NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE ==
= =
= To quote using this version, you will either type "/QUOTE" in the =
= internal editor, or use Ctrl-P Ctrl-Q in any external editor. You =
= will then be shown the message, and asked which lines to quote, =
= rather than being told to delete unneeded lines. Hopefully this =
= will get rid of some of the abuses of the older version of the mod.. =
= =
= Also, be sure you understand the comments in the get_quote part in =
= EXTRN.C for getting it set up correctly with the external editors =
= you have installed. =
= =
== NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE == NOTE ==
Before I start with the mod though, the first change is to FSED's CONSOLE.CFG
file (assuming you have FSED installed as an available editor. If not, ignore
this paragraph). You will need to add the following line to enable the redraw
function locally (I actually copied many of the commands from the WORDSTAR.CFG
file to make the commands locally and remotely the same, in addition to the
special local functions).
C 28 "^B" # repaint screen
=============================================================================
Many BBS software programs these days offer a "quoting" feature when replying
messages, which provides a "> " at the beginning of each quoted line, plus
provides the quoted text after it. For example, you would see a message like:
------------------------------------------------------------------------------
> How can I get rid of the DGROUP error in WWIV? I've been modding my board
> and now I get that whenever I recompile.
A DGROUP error means that you've run of out variable space in the board.....
------------------------------------------------------------------------------
Finally, in WWIV 4.21a, Wayne Bell added limited quoting support. The text of
the message is written to the file QUOTES.TXT, and the "indented" form written
to QUOTES.IND. But the external editor doesn't use the quote function, and
the only external editor that supports it is WWIVedit. Not to say that
WWIVedit isn't a good editor, since it's the one I use all the time, but not
every can use it, and some people do prefer others. So, if you got used to
these functions with earlier versions of WWIV with the old quote mod, here's
your chance to get them back.
OK, now for the first part of the mod. Load up FCNS.H and make the following
addition for void get_quote:
int full_external(char *s, int ctc, int ccc);
char *create_chain_file(char *fn);
void get_quote(int fsed); /* mod - add */
Save FCNS.H and load VARS.H, and add the following variable declarations:
/****************************************************************************/
__EXTRN__ int bquote,equote,quoting; /* mod - add */
__EXTRN__ char ansistr[81], cdir[81], charbuffer[161], chatreason[81],
crttype, curspeed[81], dc[81], dcd[81], dszlog[81],
/****************************************************************************/
Then load up EXTRN.C, and make the following changes at the top of
unsigned char getkeyext() to intercept the keys in the external editor:
if (holding) {
holding=0;
return(held);
}
ch=getkey();
if ((charbufferpointer==0) && (bquote==0)) { /* mod - change */
if (ch==16) {
ch=getkey();
if ((ch==17) && (charbufferpointer==0) && /* mod - add */
(quotes_ind!=NULL)) { /* mod - add */
get_quote(1); /* mod - add */
/* change the following lines based on the setup */
/* for your external editors. The numbers in the */
/* case statement should be the control code for */
/* the screen redraw command. For example, FSED */
/* uses Ctrl-B, which is the second letter of the */
/* alphabet, which means you need a 2 for the */
/* return code. Known editors are: */
/* */
/* Editor Key Code */
/* ------ ------ ---- */
/* FSED Ctrl-B 2 */
/* FEDIT Ctrl-R 18 */
/* ZARFF Ctrl-E 5 */
/* ED Ctrl-L 12 */
/* WWIVEDIT Ctrl-R 18 */
/* */
/* Don't forget to change this to match whatever */
/* your editor setup is. */
/* */
/* Note: The quote mod currently does not work */
/* with ZARFF (also known as ZEDIT) because it */
/* seems to bypass WWIV's interrupt processing. */
/* Sorry, but there's nothing I can do to fix */
/* that one, but it should work fine with any of */
/* the others. */
switch (thisuser.defed) { /* mod - add */
case 1 : /* mod - add */
ch=2; /* mod - add */
break; /* mod - add */
case 2 : /* mod - add */
ch=18; /* mod - add */
break; /* mod - add */
case 3 : /* mod - add */
ch=5; /* mod - add */
break; /* mod - add */
case 4 : /* mod - add */
ch=12; /* mod - add */
break; /* mod - add */
case 5 : /* mod - add */
ch=18; /* mod - add */
break; /* mod - add */
default : /* mod - add */
ch=0; /* mod - add */
break; /* mod - add */
} /* mod - add */
return(ch); /* mod - add */
} /* mod - add */
if ((ch==1) && (charbufferpointer==0)) {
strcpy(charbuffer,&(thisuser.macros[2][0]));
Scroll down to void far interrupt newintr1(...), and add the following two
lines near the top of the void:
ni_ch=ni_r.h.ah;
ni_ch1=0;
if (quoting) /* mod - add */
ni_ch=0; /* mod - add */
switch(ni_ch) {
case 0x01:
NEW_STK();
Then at the bottom of the file, read in the following code to handle the
quoting of the message:
void get_quote(int fsed) /* mod - add entire void */
{
static char s[141];
static int i,i1,i2,abort,next,rl;
static int l1,l2;
quoting=fsed;
rl=1;
do {
if (fsed)
outstr("\x0c");
if (rl) {
i=1; l1=l2=0; abort=0; next=0;
do {
if (quotes_ind[l2++]==10)
l1++;
} while ((l2<quotes_ind_l) && (l1<2));
do {
itoa(i++,s,10);
osan(s,&abort,&next);
if (irt_name[0]) {
s[0]=32;
i1=1;
} else
i1=0;
if (abort) {
do {
l2++;
} while ((quotes_ind[l2]!=13) && (l2<quotes_ind_l));
} else {
do {
s[i1++]=quotes_ind[l2++];
} while ((quotes_ind[l2]!=13) && (l2<quotes_ind_l));
}
if (quotes_ind[l2]) {
l2+=2;
s[i1]=0;
}
pla(s,&abort);
} while (l2<quotes_ind_l);
--i;
}
nl();
i1=0; i2=0; s[0]=0;
while (!s[0]) {
sprintf(s,"Quote from line 1-%d? (?=relist,Q=quit) ",i);
prt(2,s);
input(s,3);
}
if (s[0]=='Q')
rl=0;
else if (s[0]!='?') {
i1=atoi(s);
if (i1==i)
i2=i1;
else {
s[0]=0;
while (!s[0]) {
sprintf(s,"through line %d-%d? (Q=quit) ",i1,i);
prt(2,s);
input(s,3);
}
if (s[0]=='Q')
rl=0;
else if (s[0]!='?')
i2=atoi(s);
}
}
if (i2) {
sprintf(s,"Quote line(s) %d-%d? ",i1,i2);
prt(5,s);
if (!ny())
i2=0;
}
} while ((!abort) && (!hangup) && (rl) && (!i2));
quoting=0;
charbufferpointer=0;
if ((i1>0) && (i2>=i1) && (i2<=i) && (rl)) {
bquote=i1;
equote=i2;
}
}
Save EXTRN.C and load up COM.C. Find int empty() and make the following
change:
int empty()
{
if (kbhitb() || (incom && (head != tail)) ||
(charbufferpointer && charbuffer[charbufferpointer]) ||
(in_extern == 2) || (bquote)) /* mod - change */
return(0);
return(1);
}
Then make the following changes in char inkey() to allow the quote to be read
in to the current message:
char ch=0;
static int qpointer=0,cpointer; /* mod - add */
/* mod - add */
if (bquote) { /* mod - add */
if (!qpointer) { /* mod - add */
charbuffer[1]=48; /* mod - add */
charbuffer[2]=13; /* mod - add */
charbuffer[3]=0; /* mod - add */
cpointer=0; /* mod - add */
qpointer=1; /* mod - add */
while (qpointer<bquote+2) { /* mod - add */
if (quotes_ind[cpointer++]==10) /* mod - add */
++qpointer; /* mod - add */
} /* mod - add */
charbufferpointer=1; /* mod - add */
} /* mod - add */
if (quotes_ind[cpointer]==10) { /* mod - add */
++qpointer; /* mod - add */
if (qpointer>equote+2) { /* mod - add */
qpointer=0; bquote=0; equote=0; /* mod - add */
return(16); /* mod - add */
} else /* mod - add */
++cpointer; /* mod - add */
} /* mod - add */
if (quotes_ind[cpointer]==3) { /* mod - add */
++cpointer; /* mod - add */
return(16); /* mod - add */
} /* mod - add */
if (quotes_ind[cpointer]==0) { /* mod - add */
qpointer=0; bquote=0; equote=0; /* mod - add */
return(13); /* mod - add */
} /* mod - add */
return(quotes_ind[cpointer++]); /* mod - add */
} /* mod - add */
if (x_only)
return(0);
if (charbufferpointer) {
if (!charbuffer[charbufferpointer])
charbufferpointer = charbuffer[0] = 0;
else { /* mod - change */
if ((charbuffer[charbufferpointer])==3) /* mod - add */
charbuffer[charbufferpointer]=16; /* mod - add */
return(charbuffer[charbufferpointer++]);
} /* mod - add */
}
Then load XINIT.C, and add the following code to initialize the quote
variables in void init(...):
sysop_alert=0;
global_handle=0;
bquote=0; /* mod - add */
equote=0; /* mod - add */
quoting=0; /* mod - add */
Save XINIT.C and load MSGBASE.C. Scroll down to void inmsg(...), and add the
following lines:
if (s[0]=='/') {
if (stricmp(s,"/HELP")==0) {
savel=0;
printmenu(2);
}
if (stricmp(s,"/QUOTE")==0) { /* mod - add */
savel=0; /* mod - add */
if (quotes_ind!=NULL) /* mod - add */
get_quote(0); /* mod - add */
} /* mod - add */
if (stricmp(s,"/LI")==0) {
savel=0;
Save MSGBASE.C and load MSGBASE1.C. Now, we get to make some changes to
Wayne's quote routines for 4.22. These allow you to easily change the color
of the prompt character, preserve the color of the quoted text, and make it a
little better at flowing the text (but still far from perfect). Note that the
PFXCOL variable is the color of the '>' used to designate a quote, which can
be changed to any WWIV color you want. The remainder of the text is displayed
in whatever color the original message was in, which makes sense to me, but it
wouldn't be too hard to change that either... if it seemed to be worth the
trouble. Scroll down near the end of the file and make the following changes:
#define LINELEN 79
#define SAVE_IN_MEM /* mod - add */
#define PFXCOL 2 /* mod - add */
#define QUOTECOL 0 /* mod - add */
/* mod - add the define for WRTPFX, and replace the defines for NL and FLSH */
#define WRTPFX {fprintf(f,"\003%c",PFXCOL+48);if (tf==1)\
cp=fwrite(pfx,1,pfxlen-1,f); else cp=fwrite(pfx,1,pfxlen,f);\
fprintf(f,"\003%c",cc);}
#define NL {if (!cp) {fprintf(f,"\003%c",PFXCOL+48);fwrite(pfx,1,pfxlen,f);}\
if (ctlc) fwrite("0",1,1,f);fwrite("\r\n",1,2,f);cp=ns=ctlc=0;}
#define FLSH {if (ss1) {if (cp && (l3+cp>=linelen)) NL else if (ns)\
cp+=fwrite(" ",1,1,f);if (!cp) {if (ctld)\
fprintf(f,"\004%c",ctld);ctld=0; WRTPFX; } fwrite(ss1,1,l2,f);\
cp+=l3;ss1=NULL;l2=l3=0;ns=1;}}
int brtnm; /* mod - add */
int ste(int i) /* mod - add entire void */
{
if ((irt_name[i]==32) && (irt_name[i+1]=='O') && (irt_name[i+2]=='F') &&
(irt_name[i+3]==32))
if (irt_name[i+4]>47 && irt_name[i+4]<58)
return(0);
if (irt_name[i]==96)
brtnm++;
return(1);
}
char *quoteinitials(void) /* mod - add entire void */
{
static char qi[8];
int i,i1;
brtnm=0;
if (irt_name[0]==96)
qi[0]=irt_name[2];
else
qi[0]=irt_name[0];
i1=1;
for (i=1; i<strlen(irt_name) && (i1<6) && (irt_name[i]!='#') && ste(i) &&
brtnm!=2; i++)
if ((irt_name[i]==32) && (irt_name[i+1]!='#') && (irt_name[i+1]!=96))
qi[i1++]=irt_name[i+1];
qi[i1]=0;
strcat(qi,"> ");
return(qi);
}
void grab_quotes(messagerec *m, char *aux)
{
char *ss,*ss1;
long l,l1,l2,l3;
FILE *f;
char *pfx=quoteinitials(); /* mod - change */
int cp=0,ctla=0,ctlc=0,ns=0,ctld=0,ff;
int pfxlen=strlen(pfx); /* mod - change */
char cc=QUOTECOL+48; /* mod - add */
int linelen=LINELEN,tf=0; /* mod - add */
long lp; /* mod - add */
/* mod - delete pfx=get_stringx(1,102); */
/* mod - delete pfxlen=strlen(pfx); */
unlink("quotes.txt");
unlink("quotes.ind");
And a little farther down:
case '\n':
tf=0; /* mod - add */
if (ctla) {
ctla=0;
} else {
cc=QUOTECOL+48; /* mod - add */
FLSH;
NL;
}
break;
case ' ':
case '\r':
if (ss1) {
FLSH;
} else {
if (ss[l1]==' ') {
if (cp+1>=linelen) /* mod - change */
NL;
if (!cp) {
if (ctld)
fprintf(f,"\x4%c",ctld);
ctld=0;
WRTPFX; /* mod - change */
}
cp++;
fwrite(" ",1,1,f);
}
}
break;
default:
if (!ss1)
ss1=ss+l1;
l2++;
if (ctlc) { /* mod - change */
if (ss[l1]==48) /* mod - add */
ss[l1]=QUOTECOL+48; /* mod - add */
cc=ss[l1]; /* mod - add */
ctlc=0;
} else { /* mod - change */
l3++;
if (!tf) { /* mod - add */
if (ss[l1]=='>') { /* mod - add */
tf=1; /* mod - add */
linelen=LINELEN; /* mod - add */
} else { /* mod - add */
tf=2; /* mod - add */
linelen=LINELEN-5; /* mod - add */
} /* mod - add */
} /* mod - add */
} /* mod - add */
break;
That's it for the source code changes, at least for this version. Just update
the menus to reflect the changes, and recompile the entire board (since FCNS.H
has changed).